#include "RIVIATick.h"
#include "opencv2/core/utility.hpp"

RIVIATick::RIVIATick() :
    m_startT(0)
{

}

RIVIATick::~RIVIATick()
{

}

void RIVIATick::startTime()
{
    m_startT = (double)cv::getTickCount();
}

double RIVIATick::getTimePassed(timetype type)
{
    double t = ((double)cv::getTickCount() - m_startT)/cv::getTickFrequency();
    switch(type)
    {
    case SECOND:
        return t;
    case MILLISECONDS:
        return 1000 * t;
    }
    return t;
}
